package biblio.main;

import java.util.Calendar;
import java.util.GregorianCalendar;

import biblio.metier.Adherent;
import biblio.metier.Employe;
import biblio.outil.BiblioException;


public class AdherentDAO {

	
	public static Adherent [] AdherentDAO= {
		new Adherent ("Tata", "Yoyo", "femme", new GregorianCalendar(1970, Calendar.APRIL, 27).getTime(), "tayo", "1+" , 1, "3617verif"),
		new Adherent ("Tete", "Yaya", "homme", new GregorianCalendar(1980, Calendar.JANUARY, 12).getTime(), "plop", "2+" , 2, "118218"),
		new Adherent ("Titi", "Yeye", "femme", new GregorianCalendar(1976, Calendar.FEBRUARY, 6).getTime(), "teye", "3+" , 3, "118712"),
	};
	
	public Adherent findByKey(int id){
		for (Adherent a  : AdherentDAO){
			if (id == a.getIdUtilisateur()) return a;	
			}
		try {
			throw new BiblioException("utilisateur inconnu");
		} 
		catch (BiblioException e) {
			e.printStackTrace();
		}
		return null;
	}
}
